package com.study.advice.demo.around;


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import java.util.Date;

public class AroundAdvice implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Object[] args = invocation.getArguments();
        System.out.println("服务用户-ID：" + args[0]);
        //调用目标方法
        Object obj = invocation.proceed();
        System.out.println("服务调用结束：" + new Date());
        return obj;
    }
}
